<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script
	src="${pageContext.request.contextPath}/resources/js/jquery-1.9.1.min.js"></script>
<script
	src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/resources/css/main_font.css" />
<title>四川芝麻开门管理系统——主页</title>
</head>
<body>
	<div class="container">
		<c:set var="housekeeper" scope="session" value="${housekeeper}" />
		<c:if test="${housekeeper==null}">
			<span><a
				href="${pageContext.request.contextPath}/pagejump/toLogin">您未登陆哦，请登陆！</a></span>
		</c:if>
		<c:if test="${housekeeper!=null}">
			<span>${sessionScope.housekeeper.name},欢迎您！<a
				href="${pageContext.request.contextPath}/pagejump/toLogin">退出登陆</a></span>
		</c:if>
	</div>
	<div class="container">
		<span>主页</span>
	</div>
	<div class="container">
		<div id="Return">
			<c:set var="response" scope="request" value="${serverResponse}" />
			<c:if test="${response.status==1}">
				<font color='red'>${response.msg}</font>
			</c:if>
		</div>
		<c:set var="housekeeper" scope="session" value="${housekeeper}" />
		<c:if test="${housekeeper!=null}">
			<c:if
				test="${(housekeeper.user_grade>10 && housekeeper.user_grade<=20) || (housekeeper.user_grade>80 && housekeeper.user_grade<=99)}">
				<div>
					<a href="${pageContext.request.contextPath}/admin/warehouse"><button
							type="button" class="btn btn-primary btn-lg">库房管理</button></a>
				</div>
			</c:if>
		</c:if>
		<c:if test="${housekeeper!=null}">
			<c:if
				test="${(housekeeper.user_grade>10 && housekeeper.user_grade<=20)}">
				<div>
					<a href="${pageContext.request.contextPath}/admin/housekeeper_insert?gradeId=${housekeeper.user_grade}"><button
							type="button" class="btn btn-primary btn-lg">管家账号增加</button></a>
				</div>
			</c:if>
		</c:if>
		<c:if test="${housekeeper!=null}">
			<c:if
				test="${(housekeeper.user_grade>20 && housekeeper.user_grade<=30) || (housekeeper.user_grade>80 && housekeeper.user_grade<=99)}">
				<div>
					<a href="${pageContext.request.contextPath}/admin/product_use"><button
							type="button" class="btn btn-primary btn-lg">产品使用管理</button></a>
				</div>
			</c:if>
		</c:if>
		<c:if test="${housekeeper!=null}">
			<c:if
				test="${(housekeeper.user_grade>20 && housekeeper.user_grade<=30) || (housekeeper.user_grade>80 && housekeeper.user_grade<=99)}">
				<div>
					<a href="${pageContext.request.contextPath}/admin/repeatedly_visit"><button
							type="button" class="btn btn-primary btn-lg">售后回访管理</button></a>
				</div>
			</c:if>
		</c:if>
		<c:if test="${housekeeper!=null}">
			<c:if
				test="${(housekeeper.user_grade>20 && housekeeper.user_grade<=30)}">
				<div>
					<a href="${pageContext.request.contextPath}/admin/housekeeper_insert?gradeId=${housekeeper.user_grade}"><button
							type="button" class="btn btn-primary btn-lg">管家账号增加</button></a>
				</div>
			</c:if>
		</c:if>
		<c:if test="${housekeeper!=null}">
			<c:if
				test="${(housekeeper.user_grade>80 && housekeeper.user_grade<=99)}">
				<div>
					<a href="${pageContext.request.contextPath}/admin/housekeeper"><button
							type="button" class="btn btn-primary btn-lg">管家信息管理</button></a>
				</div>
			</c:if>
		</c:if>
		<c:if test="${housekeeper!=null}">
			<c:if
				test="${(housekeeper.user_grade>80 && housekeeper.user_grade<=99)}">
				<div>
					<a href="${pageContext.request.contextPath}/admin/service"><button
							type="button" class="btn btn-primary btn-lg">服务点管理</button></a>
				</div>
			</c:if>
		</c:if>
		<c:if test="${housekeeper!=null}">
			<c:if
				test="${(housekeeper.user_grade>80 && housekeeper.user_grade<=99)}">
				<div>
					<a href="${pageContext.request.contextPath}/admin/productManage"><button
							type="button" class="btn btn-primary btn-lg">产品信息管理</button></a>
				</div>
			</c:if>
		</c:if>
	</div>
</body>
</html>